package com.school.dao;

import com.school.dto.score.GetScoreDTO;
import com.school.model.Score;
import com.school.vo.score.ScoreRankVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ScoreMapper {
    int deleteByPrimaryKey(Integer id);

    int insertSelective(Score record);

    Score selectByPrimaryKey(Integer id);

    /**
     * 查看教师平均分数，以打分者类型区分
     * @param tId
     * @return
     */
    List<Score> selectAVGBytTId(Integer tId);

    List<Score> selectAVGBytTIds(@Param("ids") List<Integer> ids);

    Score getByTIdAndDId(GetScoreDTO dto);

    List<ScoreRankVO> sumRank(@Param("tId") Integer tId,@Param("depId") Integer depId,@Param("cRole") Integer cRole,@Param("group") String group,@Param("isOne")String isOne);

    List<ScoreRankVO> avgRank(@Param("tId") Integer tId,@Param("depId") Integer depId,@Param("cRole") Integer cRole,@Param("group") String group,@Param("isOne")String isOne);

    List<ScoreRankVO> countRank(@Param("tId") Integer tId,@Param("depId") Integer depId,@Param("cRole") Integer cRole,@Param("group") String group,@Param("isOne")String isOne);

    int updateByPrimaryKeySelective(Score record);

    Score selectByTidAndCommentatorId(@Param("tId") Integer tId,@Param("commentatorId") Integer commentatorId);

    Score getMyToTeacher(@Param("cId") Integer cId,@Param("tId") Integer tId);

    int deleteByDepId(Score record);

    List<Score> getArray(@Param("tId") Integer tId);


}